/*
 *  untitled.h
 *
 *
 *  Created by Peter on 23.02.12.
 *  Copyright 2012 __MyCompanyName__. All rights reserved.
 *
 */
#ifndef A_BIN_H
#define A_BIN

#include "AObject.h"
#include "AvTypes.h"

#include <list>

class ABinViewSetting; // in ABinViewSetting.h
class AAttrList;       // in AAttrList.h
class AComposition;    // in AComposition.h

/*
 * Version: 14 (MC 5.5 OS X)
 */
class ABin : public AObject
{

public:

	A_DECLARE_CLASS( 'ABIN', ABin, AObject );

	ABin();

	virtual void readFromStream( AStream& str, const AObjDoc& objd );

	virtual void dump( std::ostream& str ) const;

	// ----- nested classes / typedefs -----

	struct SiftSettings
	{
		Int16           _siftMethod;  // 1
		std::string     _siftString;  // ""
		std::string     _siftColumn;  // "Any"
	};

	struct BinObject
	{
		AComposition* _composition; // The composition represented
		Int16         _xPos;        // -3000
		Int16         _yPos;        // -3000
		Int32         _keyframe;    // 0
		bool          _userPlaced;  // True/False
	};

	// ----- data members -----
	
	typedef std::list< BinObject* > ObjectList;

	ABinViewSetting* _binViewSetting;
	UInt32           _binUidHigh;
	UInt32           _binUidLow;
	Int16            _numObjects;  // Set to -1 if empty?! Probably not needed as a member since we have _objects.size()

	ObjectList       _objects;

	Int32            _displayMask; // 25271
	Int16            _displayMode; // 0
	bool             _sifted;      // false
	SiftSettings     _siftSettings[ 6 ]; // The "Custom Sift" dialog has six rows
    Int16            _numSortColumns; // 0
	Int16            _macFont;        // 1
	Int16            _macFontSize;   // 10
	Int16            _macImageScale;  // 3

	// Structures - those know how to serialize themselves
	AvRect           _homeRect; // 371, 0, 521, 320
	AvRgbColor       _backColor; // 31232, 31232, 31232
	AvRgbColor       _foreColor; // 5632, 5632, 5632

	Int16            _qlImageScale; // 6
	AAttrList*       _binAttr;   // TODO: Document common attributes store there
	bool             _wasIconic; // False
};

#endif /*Inclusion Guard*/
